home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / glob.n < prev    next >
Text File  |  1994-09-20  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4. glob(n)               Tcl Built-In Commands                   7.0
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      glob - Return names of files that match patterns
  12.  
  13. SYNOPSIS
  14.      glob ?_s_w_i_t_c_h_e_s? _p_a_t_t_e_r_n ?_p_a_t_t_e_r_n ...?
  15. _________________________________________________________________
  16.  
  17.  
  18. DESCRIPTION
  19.      This command performs file name ``globbing''  in  a  fashion
  20.      similar  to  the  csh shell.  It returns a list of the files
  21.      whose names match any of the _p_a_t_t_e_r_n arguments.
  22.  
  23.      If the initial arguments to glob start with - then they  are  |
  24.      treated  as  switches.  The following switches are currently  |
  25.      supported:                                                    |
  26.  
  27.      -nocom-  |
  28.                     plain                                                        ||
  29.                     Allows an empty list to be  returned  without  |
  30.                     error;   without  this  switch  an  error  is  |
  31.                     returned if the result list would be empty.    |
  32.  
  33.      --                                                                 ||
  34.                     Marks the end of switches.  The argument fol-  |
  35.                     lowing this one will be treated as a  _p_a_t_t_e_r_n  |
  36.                     even if it starts with a -.
  37.  
  38.      The _p_a_t_t_e_r_n arguments may contain any of the following  spe-
  39.      cial characters:
  40.  
  41.      ?         Matches any single character.
  42.  
  43.      *         Matches any sequence of zero or more characters.
  44.  
  45.      [_c_h_a_r_s]   Matches any single character in _c_h_a_r_s.   If  _c_h_a_r_s
  46.                contains a sequence of the form _a-_b then any char-
  47.                acter between _a and _b (inclusive) will match.
  48.  
  49.      \_x        Matches the character _x.
  50.  
  51.      {_a,_b,...} Matches any of the strings _a, _b, etc.
  52.  
  53.      As with csh, a  ``.'' at the beginning of a file's  name  or
  54.      just  after  a ``/'' must be matched explicitly or with a {}
  55.      construct.   In  addition,  all  ``/''  characters  must  be
  56.      matched explicitly.
  57.  
  58.      If the first character in a _p_a_t_t_e_r_n is ``~'' then it  refers
  59.      to  the  home  directory for the user whose name follows the
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. glob(n)               Tcl Built-In Commands                   7.0
  71.  
  72.  
  73.  
  74.      ``~''.  If the ``~'' is followed immediately by  ``/''  then
  75.      the value of the HOME environment variable is used.
  76.  
  77.      The glob command differs from  csh  globbing  in  two  ways.
  78.      First,  it does not sort its result list (use the lsort com-
  79.      mand if you  want  the  list  sorted).   Second,  glob  only  |
  80.      returns  the  names of files that actually exist;  in csh no  |
  81.      check for existence is made unless a pattern contains  a  ?,  |
  82.      *, or [] construct.
  83.  
  84.  
  85. KEYWORDS
  86.      exist, file, glob, pattern
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Tcl                                                             2
  130.  
  131.  
  132.  
  133.